from sqlalchemy import Column, Integer, String, Float, Identity, DateTime
from app.database import Base

class Concrete(Base):
    __tablename__ = "concrete"

    # 基本信息
    id = Column(Integer, Identity(), primary_key=True)
    source = Column(String(50), nullable=False, comment='数据来源')
    remark_1 = Column(String(50), nullable=False, comment='备注1(时间戳)')
    remark_2 = Column(String(50), nullable=False, comment='备注2(日期-序号)')
    remark_3 = Column(String(50), comment='备注3')
    remark_4 = Column(String(50), comment='备注4')
    discharge_time = Column(DateTime, nullable=False, comment='出料时间')
    baocunshijian = Column(DateTime, nullable=False, comment='保存时间')
    mp_num = Column(String(50), nullable=False, comment='拌合站编号')
    
    # 工程信息
    projectname = Column(String(200), comment='工程名称')
    strength_grade = Column(String(50), nullable=False, comment='强度等级')
    place_part = Column(String(200), nullable=False, comment='浇筑部位')
    volume = Column(Float, nullable=False, comment='方量')
    stir_time = Column(Integer, nullable=False, comment='搅拌时间')
    tld = Column(String(50), comment='塌落度')
    is_p = Column(String(1), comment='是否合格')
    biaoshi = Column(String(1), comment='标识')
    
    # 实际骨料
    stone_1 = Column(Float, comment='1#石实际用量')
    stone_2 = Column(Float, comment='2#石实际用量')
    stone_3 = Column(Float, comment='3#石实际用量')
    stone_4 = Column(Float, comment='4#石实际用量')
    stone_5 = Column(Float, comment='5#石实际用量')
    stone_6 = Column(Float, comment='6#石实际用量')
    stone_7 = Column(Float, comment='7#石实际用量')
    
    # 理论骨料
    th_stone_1 = Column(Float, comment='1#石理论用量')
    th_stone_2 = Column(Float, comment='2#石理论用量')
    th_stone_3 = Column(Float, comment='3#石理论用量')
    th_stone_4 = Column(Float, comment='4#石理论用量')
    th_stone_5 = Column(Float, comment='5#石理论用量')
    th_stone_6 = Column(Float, comment='6#石理论用量')
    th_stone_7 = Column(Float, comment='7#石理论用量')
    
    # 水
    water_1 = Column(Float, comment='1#水实际用量')
    water_2 = Column(Float, comment='2#水实际用量')
    th_water_1 = Column(Float, comment='1#水理论用量')
    th_water_2 = Column(Float, comment='2#水理论用量')
    
    # 水泥
    sn_1 = Column(Float, comment='1#水泥实际用量')
    sn_2 = Column(Float, comment='2#水泥实际用量')
    sn_3 = Column(Float, comment='3#水泥实际用量')
    th_sn_1 = Column(Float, comment='1#水泥理论用量')
    th_sn_2 = Column(Float, comment='2#水泥理论用量')
    th_sn_3 = Column(Float, comment='3#水泥理论用量')
    
    # 砂子
    sz_1 = Column(Float, comment='1#砂子实际用量')
    sz_2 = Column(Float, comment='2#砂子实际用量')
    sz_3 = Column(Float, comment='3#砂子实际用量')
    th_sz_1 = Column(Float, comment='1#砂子理论用量')
    th_sz_2 = Column(Float, comment='2#砂子理论用量')
    th_sz_3 = Column(Float, comment='3#砂子理论用量')
    
    # 煤灰
    mh_1 = Column(Float, comment='1#煤灰实际用量')
    mh_2 = Column(Float, comment='2#煤灰实际用量')
    th_mh_1 = Column(Float, comment='1#煤灰理论用量')
    th_mh_2 = Column(Float, comment='2#煤灰理论用量')
    
    # 减水剂
    jsj_1 = Column(Float, comment='1#减水剂实际用量')
    jsj_2 = Column(Float, comment='2#减水剂实际用量')
    th_jsj_1 = Column(Float, comment='1#减水剂理论用量')
    th_jsj_2 = Column(Float, comment='2#减水剂理论用量')
    
    # 外加剂
    wjj_1 = Column(Float, comment='1#外加剂实际用量')
    wjj_2 = Column(Float, comment='2#外加剂实际用量')
    wjj_3 = Column(Float, comment='3#外加剂实际用量')
    wjj_4 = Column(Float, comment='4#外加剂实际用量')
    th_wjj_1 = Column(Float, comment='1#外加剂理论用量')
    th_wjj_2 = Column(Float, comment='2#外加剂理论用量')
    th_wjj_3 = Column(Float, comment='3#外加剂理论用量')
    th_wjj_4 = Column(Float, comment='4#外加剂理论用量')
    
    # 矿粉
    kf_1 = Column(Float, comment='1#矿粉实际用量')
    kf_2 = Column(Float, comment='2#矿粉实际用量')
    th_kf_1 = Column(Float, comment='1#矿粉理论用量')
    th_kf_2 = Column(Float, comment='2#矿粉理论用量')